package com.rayson.yututu.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.rayson.yututu.model.entity.User;
import com.rayson.yututu.model.req.user.UserLoginReq;
import com.rayson.yututu.model.req.user.UserQueryReq;
import com.rayson.yututu.model.req.user.UserRegistReq;
import com.rayson.yututu.model.vo.LoginUserVO;
import com.rayson.yututu.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;

/**
 * @author wulei
 * @description 针对表【user(用户表)】的数据库操作Service
 * @createDate 2024-12-18 20:04:10
 */
public interface UserService extends IService<User> {


    /**
     * 用户注册
     *
     * @param userRegistReq 账号密码信息
     * @return 用户id
     */
    String regist(UserRegistReq userRegistReq);

    /**
     * 用户登录
     *
     * @param userLoginReq 账号密码
     * @return 用户信息
     */
    LoginUserVO login(UserLoginReq userLoginReq, HttpServletRequest request);

    /**
     * 获取当前登录用户
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 用户登出
     */
    void logout(HttpServletRequest request);

    /**
     * 查询用户列表
     */
    Page<UserVO> queryUserVOList(UserQueryReq userQueryReq);

    boolean isAdmin(User user);

    boolean isAdmin();

    User getCurrentUser();
}
